'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH POOL_ERROR 3POOL "May 23, 2021"
.SH NAME
pool_error, pool_strerror \- error interface to resource pools library
.SH SYNOPSIS
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <pool.h>

\fBint\fR \fBpool_error\fR(\fBvoid\fR);
.fi

.LP
.nf
\fBconst char *\fR\fBpool_strerror\fR(\fBint\fR \fIperr\fR);
.fi

.SH DESCRIPTION
The \fBpool_error()\fR function returns the error value of the last failure
recorded by the invocation of one of the functions of the resource pool
configuration library, \fBlibpool\fR.
.sp
.LP
The \fBpool_strerror()\fR function returns a descriptive null-terminated string
for each of the valid pool error codes.
.sp
.LP
The following error codes can be returned by \fBpool_error()\fR:
.SH RETURN VALUES
The \fBpool_error()\fR function returns the current pool error value for the
calling thread from among the following:
.sp
.ne 2
.na
\fB\fBPOE_ACCESS\fR\fR
.ad
.RS 22n
The operation could not be performed because the configuration was not opened
with the correct opening permissions.
.RE

.sp
.ne 2
.na
\fB\fBPOE_BADPARAM\fR\fR
.ad
.RS 22n
A bad parameter was supplied.
.RE

.sp
.ne 2
.na
\fB\fBPOE_BAD_PROP_TYPE\fR\fR
.ad
.RS 22n
An incorrect property type was submitted or encountered during the pool
operation.
.RE

.sp
.ne 2
.na
\fB\fBPOE_DATASTORE\fR\fR
.ad
.RS 22n
An error occurred within permanent storage.
.RE

.sp
.ne 2
.na
\fB\fBPOE_INVALID_CONF\fR\fR
.ad
.RS 22n
The pool configuration presented for the operation is invalid.
.RE

.sp
.ne 2
.na
\fB\fBPOE_INVALID_SEARCH\fR\fR
.ad
.RS 22n
A query whose outcome set was empty was attempted.
.RE

.sp
.ne 2
.na
\fB\fBPOE_NOTSUP\fR\fR
.ad
.RS 22n
An unsupported operation was attempted.
.RE

.sp
.ne 2
.na
\fB\fBPOE_PUTPROP\fR\fR
.ad
.RS 22n
An attempt to write a read-only property was made.
.RE

.sp
.ne 2
.na
\fB\fBPOE_OK\fR\fR
.ad
.RS 22n
The previous pool operation succeeded.
.RE

.sp
.ne 2
.na
\fB\fBPOE_SYSTEM\fR\fR
.ad
.RS 22n
An underlying system call or library function failed; \fBerrno\fR(3C) is
preserved where possible.
.RE

.sp
.LP
The \fBpool_strerror()\fR function returns a pointer to the string
corresponding to the requested error value. If the error value has no
corresponding string, \(mi1 is returned and \fBerrno\fR is set to indicate the
error.
.SH ERRORS
The \fBpool_strerror()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBESRCH\fR\fR
.ad
.RS 9n
The specified error value is not defined by the pools error facility.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
CSI	Enabled
_
Interface Stability	Unstable
_
MT-Level	Safe
.TE

.SH SEE ALSO
.BR errno (3C),
.BR libpool (3LIB),
.BR attributes (7)
